//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Chart
{
    public class CustomUnit : Unit
    {
        private double _value = 1;

        public double Value
        {
            get { return _value; }
            set { _value = value; }
        }

        internal override void ReadXmlCore(ReadContext context)
        {
            using (var c = context.Read("custUnit"))
            {
                Value = c.GetDouble("val");
            }
        }

        internal override void WriteXmlCore(WriteContext context)
        {
            using (WriteContext c = context.Write("custUnit"))
            {
                c.SetDouble("val", Value);
            }
        }
    }
}